﻿//======================================================================
//
//        Copyright (C) 2015   
//        All rights reserved
//
//        filename : CardOutDetailedRpt
//        description : 白卡出库明细

//        created by XXX at  20150821
//
//======================================================================
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CardLogistics.Web.Components;
using System.Data;
using System.Text;

namespace CardLogistics.Web.MainPage.CardMaking.CardOutStorage
{
    public partial class CardOutDetailedRpt : System.Web.UI.Page
    {
         protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                string outStorageNo = Request.QueryString["outStorageNo"];//出库单号
                string separateId = "";
                StringBuilder sbStr = new StringBuilder();
                DataTable dt = CardLogistics.DAL.DbHelperSQL.GetQueryResult("select * from cardmaking_cardoutstorage where IsSubmit=5");
                if (dt.Rows.Count > 0)
                    separateId = dt.Rows[0]["SeparateId"].ToString();
                if (string.IsNullOrEmpty(separateId))
                    sbStr.Append(" SELECT * FROM v_cardmaking_cardoutdetail WHERE 1=1 ");//离盒视图
                else
                    sbStr.Append(" SELECT * FROM v_cardmaking_cardoutdetailSep WHERE 1=1 "); //非离盒视图

                sbStr.Append("  and OutStorageNo like '%" + outStorageNo.Trim().ToUpper() + "%'");//出库单号
                sbStr.Append(" order by OutStorageNo,StartNo,EndNo");
                OracleXMLReportData.GenNodeXmlData(this, sbStr.ToString(), true);
            }
        }
    }
}